package krow.dev.weathertest;

public class CodeChange {
	
	
	
	String CodeChange(String code) { // API에서 넘어온 코드로 읽은 날씨 정보를 한글로 리턴
		int changedCode = Integer.parseInt(code);
		if (changedCode == 0 || changedCode == 2) {
			code = "허리케인";
		}
		else if(changedCode == 1) {
			code = "아열대 폭풍";
		}
		else if(changedCode == 3 || changedCode == 4 || changedCode == 45) {
			code = "뇌우";
		}
		else if(changedCode == 5 || changedCode == 6 ) {
			code = "비와 눈이 내림";
		}
		else if(changedCode == 7 || changedCode == 8 ) {
			code = "약한 진눈깨비";
		}
		else if(changedCode == 9 ) {
			code = "이슬비";
		}
		
		else if(changedCode == 10 || changedCode == 35 || changedCode == 14 ) {
			code = "소낙눈";
		}
		else if(changedCode == 11 || changedCode == 12 || changedCode == 17 || changedCode == 40 ) {
			code = "소나기";
		}
		else if(changedCode == 13 || changedCode == 18) {
			code = "진눈깨비";
		}
		else if(changedCode == 15 || changedCode == 16) {
			code = "눈";
		}
		else if(changedCode == 19) {
			code = "먼지";
		}
		else if(changedCode == 20) {
			code = "안개";
		}
		else if ( changedCode == 21) {
			code = "아지랑이";
		}
		else if(changedCode == 22) {
			code = "연무";
		}
		else if(changedCode == 23 || changedCode == 24 || changedCode == 25 ) {
			code = "강풍이 붐";
		}
		else if(changedCode == 26 || changedCode == 38 || changedCode == 39 ) {
			code = "흐림";
		}
		
		else if(changedCode == 27 || changedCode == 28 ) {
			code = "대체로 흐림";
		}
		else if(changedCode == 30 || changedCode == 29 || changedCode == 44) {
			code = "한때 흐림";
		}
		else if(changedCode == 34 || changedCode == 33 ) {
			code = "대체로 청명함";
		}
		else if(changedCode == 31 || changedCode == 32 || changedCode == 36) {
			code = "청명함";
		}
		else if(changedCode == 37 || changedCode == 47 ) {
			code = "고립형 뇌우";
		}
		else if(changedCode == 41 || changedCode == 42 || changedCode == 43 || changedCode == 46 ) {
			code = "폭설";
		}
		else if(changedCode == 3200) {
			code = "알 수 없음";
		}
		return code;
	}
	
	String DayChange(String day) { // API를 통해 넘어온 요일을 한글로 다시 리턴
		if(day.equals("Mon")) {
			day = "월요일";
		}
		else if(day.equals("Tue")) {
			day = "화요일";
		}
		else if(day.equals("Wed")) {
			day = "수요일";
		}
		else if(day.equals("Thu")) {
			day = "목요일";
		}
		else if(day.equals("Fri")) {
			day = "금요일";
		}
		else if(day.equals("Sat")) {
			day = "토요일";
		}
		else if(day.equals("Sun")) {
			day = "일요일";
		}	
		return day;
	}
}
